{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyOLLnyLdZMjQM++e7nq0Vac"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"},"widgets":{"application/vnd.jupyter.widget-state+json":{"8bedad837ae0419b9d29ea62a4b947f7":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_bb4fd5a0f0194dfc905ee8f0fc6dfa4a","IPY_MODEL_339a82ba97e54c9988cc410523fffb88","IPY_MODEL_7fdc3d4370f74eb4b6adec4944a6a556"],"layout":"IPY_MODEL_230055d94c224bec81f9de3855e7bf67"}},"bb4fd5a0f0194dfc905ee8f0fc6dfa4a":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_ec0450c41b0f494da8c3396111694333","placeholder":"​","style":"IPY_MODEL_bb90c2635b394b27a93047fa42043ffc","value":"tokenizer_config.json: 100%"}},"339a82ba97e54c9988cc410523fffb88":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_900010a25d4f4998882fd12ef008aaea","max":25,"min":0,"orientation":"horizontal","style":"IPY_MODEL_9676b90514bd42978100e5591286bdb9","value":25}},"7fdc3d4370f74eb4b6adec4944a6a556":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_425549fe47d34712920b73b4a2844566","placeholder":"​","style":"IPY_MODEL_cf463c94de3041d9b4895f666f5c20d0","value":" 25.0/25.0 [00:00&lt;00:00, 1.35kB/s]"}},"230055d94c224bec81f9de3855e7bf67":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"ec0450c41b0f494da8c3396111694333":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"bb90c2635b394b27a93047fa42043ffc":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"900010a25d4f4998882fd12ef008aaea":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"9676b90514bd42978100e5591286bdb9":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"425549fe47d34712920b73b4a2844566":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"cf463c94de3041d9b4895f666f5c20d0":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"18f5a4d2a0ec4f05a4f63bf06992842f":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_5ddda0754aa343aa820dcb232dad647d","IPY_MODEL_c2c07f5e315042fca04d907d5fcf279f","IPY_MODEL_f0d2fb0fe04044a49264edb3f2c149d4"],"layout":"IPY_MODEL_f051499d353f4e4392312cd09d2b26d0"}},"5ddda0754aa343aa820dcb232dad647d":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_b7ebbd1ca3f347b4b26b47e4b830e924","placeholder":"​","style":"IPY_MODEL_25a978ae14d8442cba8d521f52d5d33c","value":"config.json: 100%"}},"c2c07f5e315042fca04d907d5fcf279f":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_44eeb0c1314e43aea13886c1fa76998e","max":482,"min":0,"orientation":"horizontal","style":"IPY_MODEL_2c120306c5b346e480fe587e7896a61c","value":482}},"f0d2fb0fe04044a49264edb3f2c149d4":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_54e81c4646e34dca808b5f1b64b8d0da","placeholder":"​","style":"IPY_MODEL_8afec1cab4084567bb12a64364ac8199","value":" 482/482 [00:00&lt;00:00, 19.1kB/s]"}},"f051499d353f4e4392312cd09d2b26d0":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"b7ebbd1ca3f347b4b26b47e4b830e924":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"25a978ae14d8442cba8d521f52d5d33c":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"44eeb0c1314e43aea13886c1fa76998e":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"2c120306c5b346e480fe587e7896a61c":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"54e81c4646e34dca808b5f1b64b8d0da":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"8afec1cab4084567bb12a64364ac8199":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"af5e7881cc1a4203a9536b7a2a89b7db":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_396b31c02cd742179b1acf1e7cca8a96","IPY_MODEL_81a21f801b274525b0871c7f3af2cda4","IPY_MODEL_66e66a3a9dcf468fbce720377d1ce2a5"],"layout":"IPY_MODEL_199c9d8ccdd643fc8511e3de253dba9d"}},"396b31c02cd742179b1acf1e7cca8a96":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_681bd59e0f254daa9c342b49db54912c","placeholder":"​","style":"IPY_MODEL_47903264fb6e4d87a4c66a7f5346d14e","value":"vocab.json: 100%"}},"81a21f801b274525b0871c7f3af2cda4":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_3861a504ec6d4b7785eaf8257dea84ae","max":898823,"min":0,"orientation":"horizontal","style":"IPY_MODEL_96c0b468e16d45a1a47639c5e35ec8c1","value":898823}},"66e66a3a9dcf468fbce720377d1ce2a5":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_6e9247cca6f44d17a5f3201c833d28c2","placeholder":"​","style":"IPY_MODEL_21a950b096a6466698c941c6c742e75a","value":" 899k/899k [00:00&lt;00:00, 15.9MB/s]"}},"199c9d8ccdd643fc8511e3de253dba9d":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"681bd59e0f254daa9c342b49db54912c":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"47903264fb6e4d87a4c66a7f5346d14e":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"3861a504ec6d4b7785eaf8257dea84ae":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"96c0b468e16d45a1a47639c5e35ec8c1":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"6e9247cca6f44d17a5f3201c833d28c2":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"21a950b096a6466698c941c6c742e75a":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"cd2823bcaf04446c82111bf3bfd4d95d":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_0832c12342fa44809e8ca620bb947c05","IPY_MODEL_103ef9bf20ed428c9d136ee7ceed5ccd","IPY_MODEL_fa243ff3372645efa3ce030c6a3aac6c"],"layout":"IPY_MODEL_374b2066e0984417880e9a9fc484544a"}},"0832c12342fa44809e8ca620bb947c05":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_f8fc87649ec8497d870b5003548a5e00","placeholder":"​","style":"IPY_MODEL_ee42cf47effc47eab28951b0c1cb7b6d","value":"merges.txt: 100%"}},"103ef9bf20ed428c9d136ee7ceed5ccd":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_edca73e4b82d43d687adcba0ab61c387","max":456318,"min":0,"orientation":"horizontal","style":"IPY_MODEL_25c3b168f15c4598aa87096294f8e9c5","value":456318}},"fa243ff3372645efa3ce030c6a3aac6c":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_4186b34e4c56483a96e3965618f173f2","placeholder":"​","style":"IPY_MODEL_2e4a9a5607564a139885d4780ec5f9ce","value":" 456k/456k [00:00&lt;00:00, 20.9MB/s]"}},"374b2066e0984417880e9a9fc484544a":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"f8fc87649ec8497d870b5003548a5e00":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"ee42cf47effc47eab28951b0c1cb7b6d":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"edca73e4b82d43d687adcba0ab61c387":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"25c3b168f15c4598aa87096294f8e9c5":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"4186b34e4c56483a96e3965618f173f2":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"2e4a9a5607564a139885d4780ec5f9ce":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"477e56c79e104c8dbce22ada50283c4c":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_0607b5c159d2446e87fee21fad4a4014","IPY_MODEL_2a6250abf7d040cfb47f93771bf3eb95","IPY_MODEL_4fc9d82932234272a090e04a397fbeb2"],"layout":"IPY_MODEL_41a1afc7de4c4d48a48481850910cca7"}},"0607b5c159d2446e87fee21fad4a4014":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_00564bc0d9854a0881878c12a96a5e6b","placeholder":"​","style":"IPY_MODEL_ac8c5ccac88a498797a6d16a6b103a23","value":"tokenizer.json: 100%"}},"2a6250abf7d040cfb47f93771bf3eb95":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_b4e143600f94437b979044abdd497cad","max":1355863,"min":0,"orientation":"horizontal","style":"IPY_MODEL_78bc6ea8a0c741789552340dddad414c","value":1355863}},"4fc9d82932234272a090e04a397fbeb2":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_fbdc948213f547e6b52ee80e199ebea8","placeholder":"​","style":"IPY_MODEL_10a8d30f62894cf09d64e5752dd65af7","value":" 1.36M/1.36M [00:00&lt;00:00, 46.9MB/s]"}},"41a1afc7de4c4d48a48481850910cca7":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"00564bc0d9854a0881878c12a96a5e6b":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"ac8c5ccac88a498797a6d16a6b103a23":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"b4e143600f94437b979044abdd497cad":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"78bc6ea8a0c741789552340dddad414c":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"fbdc948213f547e6b52ee80e199ebea8":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"10a8d30f62894cf09d64e5752dd65af7":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"705124b570da4cc68cbf77d20a30793e":{"model_module":"@jupyter-widgets/controls","model_name":"HBoxModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HBoxModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HBoxView","box_style":"","children":["IPY_MODEL_9f21469de9e44ea599fa20f81dafa1ee","IPY_MODEL_cc40f16aac164d02abd941351472b7ff","IPY_MODEL_70fe3173cb134f38a8b34ba8dc9eb7e8"],"layout":"IPY_MODEL_bb668461cb434780bc2223781a259d4f"}},"9f21469de9e44ea599fa20f81dafa1ee":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_523957ab2605455b86caf27c902c7bfa","placeholder":"​","style":"IPY_MODEL_9e208edd4e954ff780efff594219732d","value":"model.safetensors: 100%"}},"cc40f16aac164d02abd941351472b7ff":{"model_module":"@jupyter-widgets/controls","model_name":"FloatProgressModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"FloatProgressModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"ProgressView","bar_style":"success","description":"","description_tooltip":null,"layout":"IPY_MODEL_32b6890181714320bbff314ae5ecdbfb","max":1421700479,"min":0,"orientation":"horizontal","style":"IPY_MODEL_69e3363e259740659a673ed35894e31a","value":1421700479}},"70fe3173cb134f38a8b34ba8dc9eb7e8":{"model_module":"@jupyter-widgets/controls","model_name":"HTMLModel","model_module_version":"1.5.0","state":{"_dom_classes":[],"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"HTMLModel","_view_count":null,"_view_module":"@jupyter-widgets/controls","_view_module_version":"1.5.0","_view_name":"HTMLView","description":"","description_tooltip":null,"layout":"IPY_MODEL_b18accd8dd3349b78013d98e0716e564","placeholder":"​","style":"IPY_MODEL_d8a3a5e078024f5b873ebbfdfb04d38c","value":" 1.42G/1.42G [00:11&lt;00:00, 144MB/s]"}},"bb668461cb434780bc2223781a259d4f":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"523957ab2605455b86caf27c902c7bfa":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"9e208edd4e954ff780efff594219732d":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}},"32b6890181714320bbff314ae5ecdbfb":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"69e3363e259740659a673ed35894e31a":{"model_module":"@jupyter-widgets/controls","model_name":"ProgressStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"ProgressStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","bar_color":null,"description_width":""}},"b18accd8dd3349b78013d98e0716e564":{"model_module":"@jupyter-widgets/base","model_name":"LayoutModel","model_module_version":"1.2.0","state":{"_model_module":"@jupyter-widgets/base","_model_module_version":"1.2.0","_model_name":"LayoutModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"LayoutView","align_content":null,"align_items":null,"align_self":null,"border":null,"bottom":null,"display":null,"flex":null,"flex_flow":null,"grid_area":null,"grid_auto_columns":null,"grid_auto_flow":null,"grid_auto_rows":null,"grid_column":null,"grid_gap":null,"grid_row":null,"grid_template_areas":null,"grid_template_columns":null,"grid_template_rows":null,"height":null,"justify_content":null,"justify_items":null,"left":null,"margin":null,"max_height":null,"max_width":null,"min_height":null,"min_width":null,"object_fit":null,"object_position":null,"order":null,"overflow":null,"overflow_x":null,"overflow_y":null,"padding":null,"right":null,"top":null,"visibility":null,"width":null}},"d8a3a5e078024f5b873ebbfdfb04d38c":{"model_module":"@jupyter-widgets/controls","model_name":"DescriptionStyleModel","model_module_version":"1.5.0","state":{"_model_module":"@jupyter-widgets/controls","_model_module_version":"1.5.0","_model_name":"DescriptionStyleModel","_view_count":null,"_view_module":"@jupyter-widgets/base","_view_module_version":"1.2.0","_view_name":"StyleView","description_width":""}}}}},"cells":[{"cell_type":"markdown","source":["BERTScore is an evaluation metric that leverages the contextual embeddings generated by the BERT (Bidirectional Encoder Representations from Transformers) model to assess the quality of generated text. Unlike traditional metrics such as BLEU and ROUGE, which rely on exact n-gram matching, BERTScore compares the semantic similarity between words in the generated and reference texts by using the embeddings from the pre-trained BERT model. This approach allows for a more nuanced understanding of the quality of generated responses, particularly in capturing synonyms and paraphrases."],"metadata":{"id":"0V9pZ7kvhqya"}},{"cell_type":"markdown","source":["### First of all let's install required packages"],"metadata":{"id":"M0Vj7Ijvhssk"}},{"cell_type":"code","execution_count":1,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"7ZaNiuq0hqYX","executionInfo":{"status":"ok","timestamp":1730494871943,"user_tz":0,"elapsed":11677,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}},"outputId":"09dea4a8-092e-4780-facf-b726ab6a15b0"},"outputs":[{"output_type":"stream","name":"stdout","text":["Collecting bert-score\n","  Downloading bert_score-0.3.13-py3-none-any.whl.metadata (15 kB)\n","Requirement already satisfied: torch>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from bert-score) (2.5.0+cu121)\n","Requirement already satisfied: pandas>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from bert-score) (2.2.2)\n","Requirement already satisfied: transformers>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from bert-score) (4.44.2)\n","Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from bert-score) (1.26.4)\n","Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from bert-score) (2.32.3)\n","Requirement already satisfied: tqdm>=4.31.1 in /usr/local/lib/python3.10/dist-packages (from bert-score) (4.66.6)\n","Requirement already satisfied: matplotlib in /usr/local/lib/python3.10/dist-packages (from bert-score) (3.8.0)\n","Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.10/dist-packages (from bert-score) (24.1)\n","Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.0.1->bert-score) (2.8.2)\n","Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.0.1->bert-score) (2024.2)\n","Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas>=1.0.1->bert-score) (2024.2)\n","Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=1.0.0->bert-score) (3.16.1)\n","Requirement already satisfied: typing-extensions>=4.8.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.0.0->bert-score) (4.12.2)\n","Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.0.0->bert-score) (3.4.2)\n","Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.0.0->bert-score) (3.1.4)\n","Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from torch>=1.0.0->bert-score) (2024.10.0)\n","Requirement already satisfied: sympy==1.13.1 in /usr/local/lib/python3.10/dist-packages (from torch>=1.0.0->bert-score) (1.13.1)\n","Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from sympy==1.13.1->torch>=1.0.0->bert-score) (1.3.0)\n","Requirement already satisfied: huggingface-hub<1.0,>=0.23.2 in /usr/local/lib/python3.10/dist-packages (from transformers>=3.0.0->bert-score) (0.24.7)\n","Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers>=3.0.0->bert-score) (6.0.2)\n","Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers>=3.0.0->bert-score) (2024.9.11)\n","Requirement already satisfied: safetensors>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from transformers>=3.0.0->bert-score) (0.4.5)\n","Requirement already satisfied: tokenizers<0.20,>=0.19 in /usr/local/lib/python3.10/dist-packages (from transformers>=3.0.0->bert-score) (0.19.1)\n","Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->bert-score) (1.3.0)\n","Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib->bert-score) (0.12.1)\n","Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->bert-score) (4.54.1)\n","Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->bert-score) (1.4.7)\n","Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->bert-score) (10.4.0)\n","Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->bert-score) (3.2.0)\n","Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->bert-score) (3.4.0)\n","Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->bert-score) (3.10)\n","Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->bert-score) (2.2.3)\n","Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->bert-score) (2024.8.30)\n","Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas>=1.0.1->bert-score) (1.16.0)\n","Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.0.0->bert-score) (3.0.2)\n","Downloading bert_score-0.3.13-py3-none-any.whl (61 kB)\n","\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.1/61.1 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hInstalling collected packages: bert-score\n","Successfully installed bert-score-0.3.13\n","Requirement already satisfied: transformers in /usr/local/lib/python3.10/dist-packages (4.44.2)\n","Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers) (3.16.1)\n","Requirement already satisfied: huggingface-hub<1.0,>=0.23.2 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.24.7)\n","Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (1.26.4)\n","Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from transformers) (24.1)\n","Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (6.0.2)\n","Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers) (2024.9.11)\n","Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers) (2.32.3)\n","Requirement already satisfied: safetensors>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.4.5)\n","Requirement already satisfied: tokenizers<0.20,>=0.19 in /usr/local/lib/python3.10/dist-packages (from transformers) (0.19.1)\n","Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers) (4.66.6)\n","Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.23.2->transformers) (2024.10.0)\n","Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.23.2->transformers) (4.12.2)\n","Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (3.4.0)\n","Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (3.10)\n","Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (2.2.3)\n","Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers) (2024.8.30)\n"]}],"source":["! pip install bert-score\n","! pip install transformers"]},{"cell_type":"markdown","source":["### Import Required Libraries\n","\n","- Purpose: This line imports the BERTScorer class from the bert_score library. This library provides tools to calculate BERTScore, which measures the quality of generated text based on BERT embeddings.\n","- Why BERTScore: BERTScore is particularly useful in scenarios where semantic similarity is more critical than exact word matches, making it suitable for tasks like paraphrase detection and dialogue systems."],"metadata":{"id":"Yeb5uFNth_4n"}},{"cell_type":"code","source":["# Import necessary libraries\n","from bert_score import BERTScorer"],"metadata":{"id":"rzt9kFlah-_D","executionInfo":{"status":"ok","timestamp":1730494934399,"user_tz":0,"elapsed":5712,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}}},"execution_count":2,"outputs":[]},{"cell_type":"markdown","source":["Defining Test Cases:\n","\n","-  generated_responses contains sample outputs from a model that we want to evaluate.\n","- reference_responses holds the expected outputs or human-written responses against which the generated responses will be compared.\n","\n","\n","Purpose: This setup allows for a direct comparison to assess how well the generated text matches the reference in terms of semantic content and meaning"],"metadata":{"id":"_dU1WBEriR9p"}},{"cell_type":"code","source":["# Sample generated and reference responses\n","generated_responses = [\n","   \"I am looking for information on my account.\",\n","   \"Can you help me reset my password?\"\n","]\n","\n","reference_responses = [\n","   \"I need help with my account.\",\n","   \"I want to reset my password.\"\n","]\n"],"metadata":{"id":"itkw1m7qiRXd","executionInfo":{"status":"ok","timestamp":1730495015580,"user_tz":0,"elapsed":268,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}}},"execution_count":3,"outputs":[]},{"cell_type":"markdown","source":["BERTScorer Initialization:\n","\n","- Here, we create an instance of the BERTScorer class. The lang=\"en\" argument specifies that we are working with English text, ensuring that the appropriate BERT model for English is used.\n","- The rescale_with_baseline=True argument enables the scorer to use a baseline score for rescaling, which can help in normalizing the scores and making them more interpretable.\n","\n","\n","Why Initialization Matters: Proper initialization of the scorer ensures that the evaluation is performed correctly according to the specified language and settings."],"metadata":{"id":"j3hMSDoTinpf"}},{"cell_type":"code","source":["# Initialize BERTScorer\n","scorer = BERTScorer(lang=\"en\", rescale_with_baseline=True)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":408,"referenced_widgets":["8bedad837ae0419b9d29ea62a4b947f7","bb4fd5a0f0194dfc905ee8f0fc6dfa4a","339a82ba97e54c9988cc410523fffb88","7fdc3d4370f74eb4b6adec4944a6a556","230055d94c224bec81f9de3855e7bf67","ec0450c41b0f494da8c3396111694333","bb90c2635b394b27a93047fa42043ffc","900010a25d4f4998882fd12ef008aaea","9676b90514bd42978100e5591286bdb9","425549fe47d34712920b73b4a2844566","cf463c94de3041d9b4895f666f5c20d0","18f5a4d2a0ec4f05a4f63bf06992842f","5ddda0754aa343aa820dcb232dad647d","c2c07f5e315042fca04d907d5fcf279f","f0d2fb0fe04044a49264edb3f2c149d4","f051499d353f4e4392312cd09d2b26d0","b7ebbd1ca3f347b4b26b47e4b830e924","25a978ae14d8442cba8d521f52d5d33c","44eeb0c1314e43aea13886c1fa76998e","2c120306c5b346e480fe587e7896a61c","54e81c4646e34dca808b5f1b64b8d0da","8afec1cab4084567bb12a64364ac8199","af5e7881cc1a4203a9536b7a2a89b7db","396b31c02cd742179b1acf1e7cca8a96","81a21f801b274525b0871c7f3af2cda4","66e66a3a9dcf468fbce720377d1ce2a5","199c9d8ccdd643fc8511e3de253dba9d","681bd59e0f254daa9c342b49db54912c","47903264fb6e4d87a4c66a7f5346d14e","3861a504ec6d4b7785eaf8257dea84ae","96c0b468e16d45a1a47639c5e35ec8c1","6e9247cca6f44d17a5f3201c833d28c2","21a950b096a6466698c941c6c742e75a","cd2823bcaf04446c82111bf3bfd4d95d","0832c12342fa44809e8ca620bb947c05","103ef9bf20ed428c9d136ee7ceed5ccd","fa243ff3372645efa3ce030c6a3aac6c","374b2066e0984417880e9a9fc484544a","f8fc87649ec8497d870b5003548a5e00","ee42cf47effc47eab28951b0c1cb7b6d","edca73e4b82d43d687adcba0ab61c387","25c3b168f15c4598aa87096294f8e9c5","4186b34e4c56483a96e3965618f173f2","2e4a9a5607564a139885d4780ec5f9ce","477e56c79e104c8dbce22ada50283c4c","0607b5c159d2446e87fee21fad4a4014","2a6250abf7d040cfb47f93771bf3eb95","4fc9d82932234272a090e04a397fbeb2","41a1afc7de4c4d48a48481850910cca7","00564bc0d9854a0881878c12a96a5e6b","ac8c5ccac88a498797a6d16a6b103a23","b4e143600f94437b979044abdd497cad","78bc6ea8a0c741789552340dddad414c","fbdc948213f547e6b52ee80e199ebea8","10a8d30f62894cf09d64e5752dd65af7","705124b570da4cc68cbf77d20a30793e","9f21469de9e44ea599fa20f81dafa1ee","cc40f16aac164d02abd941351472b7ff","70fe3173cb134f38a8b34ba8dc9eb7e8","bb668461cb434780bc2223781a259d4f","523957ab2605455b86caf27c902c7bfa","9e208edd4e954ff780efff594219732d","32b6890181714320bbff314ae5ecdbfb","69e3363e259740659a673ed35894e31a","b18accd8dd3349b78013d98e0716e564","d8a3a5e078024f5b873ebbfdfb04d38c"]},"id":"ZoQ-nndUimgl","executionInfo":{"status":"ok","timestamp":1730495117307,"user_tz":0,"elapsed":17959,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}},"outputId":"d1e020bc-4a94-4252-dfcc-40f23095fc7d"},"execution_count":4,"outputs":[{"output_type":"stream","name":"stderr","text":["/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:89: UserWarning: \n","The secret `HF_TOKEN` does not exist in your Colab secrets.\n","To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n","You will be able to reuse this secret in all of your notebooks.\n","Please note that authentication is recommended but still optional to access public models or datasets.\n","  warnings.warn(\n"]},{"output_type":"display_data","data":{"text/plain":["tokenizer_config.json:   0%|          | 0.00/25.0 [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"8bedad837ae0419b9d29ea62a4b947f7"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["config.json:   0%|          | 0.00/482 [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"18f5a4d2a0ec4f05a4f63bf06992842f"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["vocab.json:   0%|          | 0.00/899k [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"af5e7881cc1a4203a9536b7a2a89b7db"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["merges.txt:   0%|          | 0.00/456k [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"cd2823bcaf04446c82111bf3bfd4d95d"}},"metadata":{}},{"output_type":"display_data","data":{"text/plain":["tokenizer.json:   0%|          | 0.00/1.36M [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"477e56c79e104c8dbce22ada50283c4c"}},"metadata":{}},{"output_type":"stream","name":"stderr","text":["/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884\n","  warnings.warn(\n"]},{"output_type":"display_data","data":{"text/plain":["model.safetensors:   0%|          | 0.00/1.42G [00:00<?, ?B/s]"],"application/vnd.jupyter.widget-view+json":{"version_major":2,"version_minor":0,"model_id":"705124b570da4cc68cbf77d20a30793e"}},"metadata":{}},{"output_type":"stream","name":"stderr","text":["Some weights of RobertaModel were not initialized from the model checkpoint at roberta-large and are newly initialized: ['roberta.pooler.dense.bias', 'roberta.pooler.dense.weight']\n","You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"]}]},{"cell_type":"markdown","source":["BERTScore Calculation:\n","\n","- The scorer.score() method computes the Precision (P), Recall (R), and F1 Score for the generated responses against the reference responses.\n","- Precision indicates how many of the words in the generated responses were relevant to the reference responses. Recall reflects how many relevant words in the references were captured by the generated responses. The F1 Score is the harmonic mean of Precision and Recall, providing a balance between the two.\n","\n","\n","Output: This line outputs three key metrics, allowing for a comprehensive evaluation of the generated text."],"metadata":{"id":"iaxLRcFui8R_"}},{"cell_type":"code","source":["# Calculate BERTScore\n","P, R, F1 = scorer.score(generated_responses, reference_responses)"],"metadata":{"id":"uLeQf210i7CI","executionInfo":{"status":"ok","timestamp":1730495172540,"user_tz":0,"elapsed":1916,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}}},"execution_count":5,"outputs":[]},{"cell_type":"markdown","source":["Displaying Results:\n","- The mean() method calculates the average score across all generated responses, providing a summary metric for each evaluation category.\n","- The item() method is used to convert the PyTorch tensor results to standard Python floats for easier readability.\n","\n","\n","Purpose: This section prints out the calculated Precision, Recall, and F1 Score, offering insights into the quality of the generated text based on semantic similarity."],"metadata":{"id":"I2EW2Ui6jQf9"}},{"cell_type":"code","source":["# Print the results\n","print(\"Precision:\", P.mean().item())\n","print(\"Recall:\", R.mean().item())\n","print(\"F1 Score:\", F1.mean().item())"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"QL5zE3V5jMbu","executionInfo":{"status":"ok","timestamp":1730495232644,"user_tz":0,"elapsed":239,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}},"outputId":"258cee36-19ba-4b71-8561-347cc1609f0c"},"execution_count":6,"outputs":[{"output_type":"stream","name":"stdout","text":["Precision: 0.4680666923522949\n","Recall: 0.587756872177124\n","F1 Score: 0.5280133485794067\n"]}]},{"cell_type":"markdown","source":["The bert_score library is imported to leverage BERT embeddings for evaluating the quality of generated text. BERTScore allows for more nuanced semantic comparisons than traditional text evaluation metrics."],"metadata":{"id":"5371cTFmmIF4"}},{"cell_type":"code","source":["from bert_score import BERTScorer"],"metadata":{"id":"AJxibxJQjbgg","executionInfo":{"status":"ok","timestamp":1730495970928,"user_tz":0,"elapsed":381,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}}},"execution_count":7,"outputs":[]},{"cell_type":"markdown","source":["Evaluation of Generated Responses:\n","\n","Generated Responses:\n","- The generated_responses list contains text outputs generated by a model.\n","     - These are the texts that will be evaluated for quality.\n","- Reference Responses:\n","    - The reference_responses list holds the expected ideal responses, serving as a benchmark for comparison against the generated outputs.\n","- Initializing BERTScorer:\n","    - Purpose: The BERTScorer is initialized for English text and is set to rescale with a baseline, which aids in producing more reliable scores."],"metadata":{"id":"XhzuGeHdmQz6"}},{"cell_type":"code","source":["scorer = BERTScorer(lang=\"en\", rescale_with_baseline=True)\n"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"-Gm699DomPuJ","executionInfo":{"status":"ok","timestamp":1730496109275,"user_tz":0,"elapsed":916,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}},"outputId":"3c04a890-7580-461c-b3aa-b79d6ff4c8ad"},"execution_count":8,"outputs":[{"output_type":"stream","name":"stderr","text":["/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884\n","  warnings.warn(\n","Some weights of RobertaModel were not initialized from the model checkpoint at roberta-large and are newly initialized: ['roberta.pooler.dense.bias', 'roberta.pooler.dense.weight']\n","You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"]}]},{"cell_type":"markdown","source":["Calculating BERT Scores:\n","- The BERT score, including precision (P), recall (R), and F1 score (F1), is calculated to assess how well the generated responses match the reference responses semantically."],"metadata":{"id":"13c60ybgmyVl"}},{"cell_type":"code","source":["P, R, F1 = scorer.score(generated_responses, reference_responses)"],"metadata":{"id":"CX3e8tiDmxXq","executionInfo":{"status":"ok","timestamp":1730496143094,"user_tz":0,"elapsed":1005,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}}},"execution_count":9,"outputs":[]},{"cell_type":"markdown","source":["Printing Evaluation Results:\n","- The mean values of precision, recall, and F1 score are printed to provide insights into the quality of the model’s responses."],"metadata":{"id":"zs1EU1oCm6Nr"}},{"cell_type":"code","source":["print(\"Generated Responses BERTScore:\")\n","print(\"Precision:\", P.mean().item())\n","print(\"Recall:\", R.mean().item())\n","print(\"F1 Score:\", F1.mean().item())\n"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"I539-Nb4m5mX","executionInfo":{"status":"ok","timestamp":1730496167665,"user_tz":0,"elapsed":3,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}},"outputId":"ffbeb3fb-2326-4a40-f44f-2682d14ea22f"},"execution_count":10,"outputs":[{"output_type":"stream","name":"stdout","text":["Generated Responses BERTScore:\n","Precision: 0.4680666923522949\n","Recall: 0.587756872177124\n","F1 Score: 0.5280133485794067\n"]}]},{"cell_type":"markdown","source":["A/B Testing Section:\n","\n","- Purpose: This section evaluates two different sets of generated responses (A and B) to determine which performs better when compared to the same reference responses.\n","- Sample Reference Responses:\n","    - The references list is defined specifically for this A/B testing context, ensuring a common baseline for both sets of responses.\n","- Defining Response Sets:\n","    - Two sets of responses (responses_A and responses_B) are created for testing. Each set contains variations of generated text that will be evaluated against the same reference responses.\n","- Calculating BERT Scores for Both Versions:\n","    - BERT scores for both response sets are calculated separately to facilitate direct comparison regarding how well each aligns with the reference responses."],"metadata":{"id":"V6ZAK2jInE6I"}},{"cell_type":"code","source":["# A/B Testing Section\n","# This section will compare two different sets of generated responses (A and B)\n","# against a common set of reference responses to evaluate which performs better.\n","# Sample reference responses for evaluation in A/B testing\n","references = [\n","    \"I need assistance with my account.\",\n","    \"Please help me reset my password.\"\n","]\n","\n","# Example A/B testing with sample responses\n","# Two sets of responses are defined here to evaluate their performance against the same reference responses.\n","responses_A = [\"Hello, how can I assist you?\", \"Can you help me with my issue?\"]\n","responses_B = [\"How may I help you today?\", \"I need help with my account.\"]\n","\n","# Calculate BERTScore for both versions (A and B) using the same references\n","# This allows for a direct comparison of how well each set of responses aligns with the reference responses\n","# in terms of precision, making it easy to identify which version is more effective.\n","P_A, _, _ = scorer.score(responses_A, references)\n","P_B, _, _ = scorer.score(responses_B, references)\n","\n","# Print precision scores for both versions\n","# Comparing the precision scores will reveal which response set (A or B) better matches the reference responses,\n","# providing insights into the efficacy of each approach.\n","print(f\"\\nVersion A BERTScore Precision: {P_A.mean().item()}\")\n","print(f\"Version B BERTScore Precision: {P_B.mean().item()}\")"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Gg1Mh5UWm_u_","executionInfo":{"status":"ok","timestamp":1730496283889,"user_tz":0,"elapsed":1659,"user":{"displayName":"Mahmoud Mohammed","userId":"00113293506867010646"}},"outputId":"604532b3-8145-4382-db48-6d760620d2c8"},"execution_count":13,"outputs":[{"output_type":"stream","name":"stdout","text":["\n","Version A BERTScore Precision: 0.0704498216509819\n","Version B BERTScore Precision: 0.12498872727155685\n"]}]},{"cell_type":"code","source":[],"metadata":{"id":"pLEKx6w0nQ1X"},"execution_count":null,"outputs":[]}]}